<?php

include '../classes/site.php';

//Get Display Values
$list = Site::getSiteBasics();
$std_sup_ratio = $list['std_sup_ratio'];
$sup_exam_mincount = $list['sup_exam_mincount'];

//Getting details about the  email information that is necessary to be shown in the page
$list = Site::getMailDetail();
$mail_email = $list['email'];
$mail_pwd = $list['password'];
$mail_smtp = $list['smtp'];


//Getting details aabout the email options
$list = Site::getMailSendingOptions();

 $mso_on_signup = $list['mso_on_signup'] ? " checked='checked' " : "";
 $mso_on_signup = $list['mso_on_enrolment'] ? " checked='checked' " : "";
 $mso_on_drop = $list['mso_on_drop'] ? " checked='checked' " : "";
 $mso_on_complete = $list['mso_on_complete'] ? " checked='checked' " : "";
 
 
?>

<?php include 'header.page.php'; ?>

	<div class="block">
    	<form method="get" action="index.php">
    	<table width="100%" border="0">
           <tr>
            <td colspan="3" align="left"><strong>Basic Details</strong><hr style="padding:0px; margin:0px;" /></td>
            </tr>
           <tr>
             <td align="right">&nbsp;</td>
             <td>&nbsp;</td>
             <td>&nbsp;</td>
           </tr>
           <tr>
            <td width="34%" align="right">Student to Supervisor Ratio :</td>
            <td width="34%"><label for="std_sup_ratio"></label>
              <input type="text" name="std_sup_ratio" id="std_sup_ratio" style="width:94%;" value="<?php echo $std_sup_ratio; ?>" /></td>
            <td width="32%" rowspan="2">These information would be used to send mail by the system.<hr style="padding:0px; margin:0px; border-color:#CCC;" /></td>
          </tr>
          <tr>
            <td align="right">Supervisor minimum allocation count :</td>
            <td><label for="sup_alloc_min"></label>
              <input type="text" name="sup_alloc_min" id="sup_alloc_min" style="width:94%;"  value="<?php echo $sup_exam_mincount; ?>" /></td>
            </tr>
          <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td align="center"><input type="submit" name="action" id="action" value="Update Basic Detail" /></td>
          </tr>
          <tr>
            <td colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3"><strong>Email Details</strong>      <hr style="padding:0px; margin:0px;" /></td>
            </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td rowspan="4" valign="bottom">These information would be used to send mail by the system.<hr style="padding:0px; margin:0px; border-color:#CCC;" /></td>
          </tr>
          <tr>
            <td align="right">Email Address :</td>.ac
            <td><label for="mail_email"></label>
              <input name="mail_email" type="text" id="mail_email" style="width:94%;" value="<?php echo $mail_email; ?>" /></td>
            </tr>
          <tr>
            <td align="right">SMTP Address :</td>
            <td><label for="mail_smtp"></label>
              <input name="mail_smtp" type="text" id="mail_smtp" style="width:94%;" value="<?php echo $mail_smtp; ?>" /></td>
            </tr>
          <tr>
            <td align="right">Password :</td>
            <td><label for="mail_pwd"></label>
              <input name="mail_pwd" type="password" id="mail_pwd" style="width:94%;" value="<?php echo $mail_pwd; ?>" /></td>
            </tr>
          <tr>
            <td align="right">Password (confirm) :</td>
            <td><label for="mail_pwd_confirm"></label>
              <input name="mail_pwd_confirm" type="password" id="mail_pwd_confirm" style="width:94%;" value="<?php echo $mail_pwd; ?>" /></td>
            <td align="center" valign="top"><input type="submit" name="action" id="action" value="Update EMail Detail" /></td>
            </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3" align="left">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3" align="left">&nbsp;</td>
          </tr>
          <tr>
            <td colspan="3" align="left"><strong>Email Sending Options</strong>
              <hr style="padding:0px; margin:0px;" /></td>
            </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td><input name="chk_on_signup" type="checkbox" id="chk_on_signup" value="1" <?php echo $mso_on_signup; ?>/>
              <label for="chk_on_signup">Send Mail on Signup</label></td>
            <td rowspan="3" valign="bottom">The system will automatically generate email to relavent supervisors in the following situations.
              <hr style="padding:0px; margin:0px; border-color:#CCC;" /></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td><input name="chk_on_drop" type="checkbox" id="chk_on_drop" value="1"  <?php echo $mso_on_drop; ?>/>
              <label for="chk_on_enrol2">Send Mail on Drop Allocation</label></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td><input name="chk_on_enrol" type="checkbox" id="chk_on_enrol" value="1"  <?php echo $mso_on_enrol; ?> />
              <label for="chk_on_enrol">Send Mail on Enrolment</label></td>
            </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td><input name="chk_on_complete" type="checkbox" id="chk_on_complete" value="1"  <?php echo $mso_on_complete; ?>/>
              <label for="chk_on_complete">Send Mail on Allocation Complete</label></td>
            <td align="center"><input type="submit" name="action" id="action" value="Update Sending Options" /></td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td align="right">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
          </tr>
      </table>
	</form>
        
  </div>
    

</div>
</div>
</body>
</html>